package jwr.basic;

public class J16_OOP_Q73 {

	public static void main(String[] args) {
		//상속, 인터페이스, 기본 클래스를 이용해서
		//Fan 상태를 출력하는 프로그램 작성
		J16MotorFan mf2 = new J16MotorFan();
		System.out.println(mf2.toString());
		
//		J16MotorFan mf = new J16MotorFan(3, true, 10, "yellow");
		J16MotorFan mf = new J16MotorFan(J16FanService.FAST, true, 10, "yellow");
		System.out.println(mf.toString());
		
//		J16MotorFan mf3 = new J16MotorFan(2, false, 5, "blue");
		J16MotorFan mf3 = new J16MotorFan(J16FanService.MEDIUM, false, 5, "blue");
		System.out.println(mf3.toString());
		
	} //main
} //class

class J16Fan implements J16FanService{
	private int speed = SLOW;
	private boolean on = false;
	private double radius = 5.0;
	private String color = "blue";
	
	public J16Fan() {
	}

	public J16Fan(int speed, boolean on, double radius, String color) {
		this.speed = speed;
		this.on = on;
		this.radius = radius;
		this.color = color;
	}

	public int getSpeed() {
		return speed;
	}

	public void setSpeed(int speed) {
		this.speed = speed;
	}

	public boolean isOn() {
		return on;
	}

	public void setOn(boolean on) {
		this.on = on;
	}

	public double getRadius() {
		return radius;
	}

	public void setRadius(double radius) {
		this.radius = radius;
	}

	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	@Override
	public String toString() {
		return "J16Fan [speed=" + speed + ", on=" + on + ", radius=" + radius
				+ ", color=" + color + "]";
	}
	
	
	
} // class

interface J16FanService{
	int  SLOW = 1;
	int  MEDIUM = 2;
	int  FAST = 3;
} // interface

class J16MotorFan extends J16Fan{
	public J16MotorFan() {
	}
	public J16MotorFan(int s, boolean o, double r, String c) {
		super(s,o,r,c);
	}
}






















